<template>
  <div>
    <h1 v-text="msg" ref="title"></h1>
    <button @click="showDom" ref="btn">点我输出上方的DOM元素</button>
    <Game ref="game"></Game>
    <Game/>
  </div>
</template>

<script>
import Game from './components/Game.vue'
export default {
    name:'App',
    data(){
        return{
            msg:'欢迎'
        }
    },
    components:{Game},
    methods:{
        showDom(){
            console.log(this.$refs.title)//真实DOM元素
            console.log(this.$refs.btn)//真实DOM元素
            console.log(this.$refs.game)//Game组件是实例对象vc
        }
    }
    
}
</script>

<style>

</style>